<template>
  <section class="good-tv">
    <h1>好剧推荐</h1>
    <ul>
      <li v-for="value of goodTvList" :key="value.title">
        <img :src="value.imgUrl" alt="" />
        <div class="right">
          <p>{{ value.title }}</p>
          <p>{{ value.describe }}</p>
          <div class="right-bottom">
            <span>{{ value.speaker }}</span>
            <button>{{ value.free }}</button>
          </div>
        </div>
      </li>
    </ul>
  </section>
</template>

<script>
import { onMounted, computed } from "vue";
import { useStore } from "vuex";
export default {
  setup() {
    const store = useStore();
    const getGoodTv = () => store.dispatch("getGoodTv");
    onMounted(() => getGoodTv());
    // 好剧推荐列表
    const goodTvList = computed(() => store.state.loudVoice.getGoodTv.result);
    return {
      goodTvList,
      getGoodTv,
    };
  },
};
</script>

<style lang="less" scoped>
.good-tv {
  font-family: PingFang SC;
  font-weight: bold;
  margin-bottom: 25px;
  h1 {
    font-size: 20px;
    color: #333333;
    margin-bottom: 14px;
  }
  ul {
    li {
      margin-bottom: 19px;
      display: flex;
      img {
        width: 90px;
        height: 121px;
        margin-right: 16px;
      }
      .right {
        position: relative;
        flex: 1;
        p {
          font-size: 16px;
          color: #000000;
          margin-bottom: 9px;
          &:last-of-type {
            color: #999999;
            font-size: 12px;
            margin: 0;
          }
        }
        .right-bottom {
          width: 100%;
          display: flex;
          justify-content: space-between;
          align-items: flex-end;
          position: absolute;
          bottom: 0;
          span {
            font-size: 12px;
            color: #d3a760;
          }
          button {
            outline: none;
            border: none;
            font-weight: bold;
            color: #333333;
            font-size: 15px;
            width: 95px;
            height: 30px;
            background: linear-gradient(270deg, #fee25e 0%, #fed414 100%);
            border-radius: 15px;
          }
        }
      }
    }
  }
}
</style>
